package gui;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JPanel;
import tipppane.Options;
import tipppane.View;

/**
 * Wir brauchen nur eine TippTab. Daher wird dieses als Singleton implementiert
 * @author IHA
 *
 */
public class TippTab extends JPanel{
	private static final long serialVersionUID = 6542204257382901872L;
	private static TippTab instance = null;

	protected TippTab() {
		setBackground(Color.DARK_GRAY);
		GridBagLayout gbl=new GridBagLayout();
		setLayout(gbl);
		GridBagConstraints gbc=new GridBagConstraints();
		gbc.fill=GridBagConstraints.BOTH;
		gbc.insets = new Insets(2,2,2,2);  
		
		gbc.gridx = 0; 
		gbc.gridy = 0;  
		gbc.weightx = 0.3;
		gbc.weighty = 1.0; 
		gbc.gridheight = 1;  
		gbl.setConstraints(Options.getInstance(), gbc);
		Options.getInstance().init();
		add(Options.getInstance());
		
		gbc.gridx = 1;  
		gbc.gridy = 0;  
		gbc.weightx = 0.7;
		gbc.weighty = 1.0; 
		gbc.gridheight = 1;  
		gbl.setConstraints(View.getInstance(), gbc);
		add(View.getInstance());
	}

	public static TippTab getInstance() {
		if (instance == null) {
			instance = new TippTab();
		}
		return instance;
	}
}
